<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伸缩导航</title>
    <style>
        .box {
            width: 200px;
            height: auto;
            user-select: none;
            -webkit-user-select: none;
        }

        label {
            display: block;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: #666;
            font-size: 30px;
            line-height: 30px;
            text-align: center;
            color: #fff;
            cursor: pointer;
            transform: rotate(360deg);
            transition: all 0.5s linear;
        }

        .nav {
            margin-top: 15px;
        }

        .nav a {
            display: block;
            width: 150px;
            height: 30px;
            background: #123;
            font-size: 14px;
            color: #fff;
            text-decoration: none;
            line-height: 30px;
            text-indent: 15px;
            margin-left: -130px;
            transition: margin-left 0.5s linear;
        }

        #checkbox: :checked+label {
            transform: rotate(0deg);
        }

        #checkbox:checked~.nav a {
            margin-left: 0px;
        }

        #checkbox:checked~.nav a:hover{
            background: #456;
        }

        .nav a:nth-child(1) {
            transition-delay: 0ms;
            border-right: 5px solid #F02452;
        }

        .nav a:nth-child(2) {
            transition-delay: 100ms;
            border-right: 5px solid #1DA037;
        }

        .nav a:nth-child(3) {
            transition-delay: 200ms;
            border-right: 5px solid #A86D33;
        }

        .nav a:nth-child(4) {
            transition-delay: 300ms;
            border-right: 5px solid #b834a4;
        }

        .nav a:nth-child(5) {
            transition-delay: 400ms;
            border-right: 5px solid #594372;
        }

        .all {
            width: 200px;
            height: auto;
            user-select: none;
            -webkit-user-select: none;
        }

        .nav1 {
            margin-top: 15px;
        }

        .nav1 a {
            display: block;
            width: 200px;
            height: 50px;
            font-size: 18px;
            font-weight: 600;
            color: #000;
            text-decoration: none;
            margin-top: 5px;
            line-height: 20px;
            border-radius: 5px;
            text-indent: 20px;
            margin-left: -180px;
            box-shadow: 1px 1px 2px #6A6A6A;
            transition: margin-left 0.5s linear;
        }

        .nav1 a:hover {
            margin-left: 0px;
        }
        .nav1 a:nth-child(1) {
            background: #771CAE;
        }

        .nav1 a:nth-child(2) {
            background: #343998;
        }

        .nav1 a:nth-child(3) {
            background: #AB3112;
        }

        .nav1 a:nth-child(4) {
            background: #124F6B;
        }

        .nav1 a:nth-child(5) {
            background: #0B4B05;
        }

        .nav1 a:nth-child(6) {
            background: #709207;
        }
    </style>    
</head>
<body>
    <div class="box">
        <input type="checkbox" id="checkbox" hidden />
        <label for="checkbox">+</label>
        <div class="nav">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">关于我们</a>
            <a href="javascript:void(0)">产品展示</a>
            <a href="javascript:void(0)">新闻动态</a>
            <a href="javascript:void(0)">联系我们</a>
        </div>
    </div>
    <div class="all">
        <div class="nav1">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">关于我们</a>
            <a href="javascript:void(0)">产品展示</a>
            <a href="javascript:void(0)">新闻动态</a>
            <a href="javascript:void(0)">联系我们</a>
            <a href="javascript:void(0)">公司地址</a>
        </div>
    </div>                
</body>
</html>